package com.huawei_jikao;
import java.util.*;

/**
 * Created by Z-hong on 2024/7/11.
 */

public class HJ3 {
    static final String YUAN="aeiouAEIOU";


    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int count = in.nextInt();
        String str=in.next();
        char[] charArray = str.toCharArray();
        int Max = 0;
        //1.遍历char数组 指针i=0；j=count+1;
        int i=0;
        int j=count+1;
        while(j<charArray.length&& i<=j-count){
            //2.i和j都指向元字母
            while(i<=j-count&&!YUAN.contains(charArray[i]+"")){i++;}
            while(j<charArray.length&&(!YUAN.contains(charArray[j]+"")||charArray[i] == charArray[j])){j++;}
            if(j>=charArray.length) break;
            //3.统计其中有多少个瑕疵;
            int xiaChi = getXiaChi(charArray,i,j);
            //4.瑕疵数等于需要的，就判断是否是最大
            if(xiaChi==count){
                Max = Math.max(Max,j-i+1);
                j++;
            }
            //5.瑕疵数少了，j++，多了i++
            else if(xiaChi<count){
                j++;
            }else{
                i++;
            }
        }
        System.out.println(Max);
    }

    public static int getXiaChi(char[]arr,int i,int j){
        int count =0;
        if(j>=arr.length|| i>j-count) return 0 ;
        while(i<j){
            if(!YUAN.contains(arr[i]+"")){
                count++;
            }
            i++;
        }
        return count;
    }
}
